﻿@{
    ViewBag.Title = "ViewPage1";
    Layout = "~/Views/Shared/BaseView.cshtml";
}
<link href="/Content/style/main.css" rel="stylesheet" type="text/css" />
<div style="width: 100%;" align="center">
    <div style="width: 750px;">
        <div style="font-size: 20pt; width: 100%; text-align: center; padding-top: 20px;">
            @ViewBag.queryyear 年 @ViewBag.querymonth 月公司交易数据统计表</div>
        <div style="height: 30px; width: 100%;">
        </div>
        <div style="font-size: 12pt; width: 100%; text-align: left;">
            一、当月总交易情况</div>
        <div style="height: 15px; width: 100%;">
        </div>
        <div>
            <div style="text-align: left;">
                <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
                    <tr>
                        <td class="title" style="text-align: center;">
                            笔数
                        </td>
                        <td class="title" style="text-align: center;">
                            手续费
                        </td>
                        <td class="title" style="text-align: center;">
                            平仓盈利
                        </td>
                        <td class="title" style="text-align: center;">
                            净收益
                        </td>
                        <td class="title" style="text-align: center;">
                            平均日盈利
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;" class="bottomyes">
                            @ViewBag.companymonthsum.BillCount
                        </td>
                        <td style="text-align: right;" class="bottomyes">
                            @string.Format("{0:N2}", ViewBag.companymonthsum.Free)
                        </td>
                        <td style="text-align: right;" class="bottomyes">
                            @string.Format("{0:N2}", ViewBag.companymonthsum.Profit)
                        </td>
                        <td style="text-align: right;" class="bottomyes">
                            @string.Format("{0:N2}", ViewBag.companymonthsum.DayCount)
                        </td>
                        <td style="text-align: right;" class="leftyes bottomyes">
                            @string.Format("{0:N2}", Math.Round(ViewBag.companymonthsum.DayCount / 22, 2))
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="height: 15px; width: 100%;">
        </div>
        <div style="font-size: 12pt; width: 100%; text-align: left;">
            二、每周交易情况</div>
        <div style="height: 15px; width: 100%;">
        </div>
        <div>
            <div style="text-align: left;">
                <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
                    <tr>
                        <td class="title" style="text-align: center;">
                            周数
                        </td>
                        <td class="title" style="text-align: center;">
                            笔数
                        </td>
                        <td class="title" style="text-align: center;">
                            手续费
                        </td>
                        <td class="title" style="text-align: center;">
                            平仓盈利
                        </td>
                        <td class="title" style="text-align: center;">
                            净收益
                        </td>
                        <td class="title" style="text-align: center;">
                            平均日盈利
                        </td>
                    </tr>
                    @{
                        int allcount = 0;
                    }
                    @foreach (BenefitHelper.Data.Week.CompanyWeekSum sum in ViewBag.companyweeksums)
                    {
                        allcount++;
                        if (allcount == ViewBag.companyweeksums.Count)
                        {
                        <tr>
                            <td style="text-align: center;" class="bottomyes">
                                @sum.Week
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @sum.BillCount
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.Free)
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.Profit)
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.DayCount)
                            </td>
                            <td style="text-align: right;" class="bottomyes leftyes">
                                @string.Format("{0:N2}", Math.Round(sum.DayCount / 5, 2))
                            </td>
                        </tr>
                        }
                        else
                        {
                        <tr>
                            <td style="text-align: center;">
                                @sum.Week
                            </td>
                            <td style="text-align: right;">
                                @sum.BillCount
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.Free)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.Profit)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.DayCount)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", Math.Round(sum.DayCount / 5, 2))
                            </td>
                        </tr>
                        }
                    }
                </table>
            </div>
        </div>
        <div style="height: 15px; width: 100%;">
        </div>
        <div style="font-size: 12pt; width: 100%; text-align: left;">
            三、交易员当月交易情况明细</div>
        <div style="height: 15px; width: 100%;">
        </div>
        <div>
            <div style="text-align: left;">
                <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
                    <tr>
                        <td class="title" style="text-align: center;">
                            交易员
                        </td>
                        <td class="title" style="text-align: center;">
                            笔数
                        </td>
                        <td class="title" style="text-align: center;">
                            平仓盈利
                        </td>
                        <td class="title" style="text-align: center;">
                            手续费
                        </td>
                        <td class="title" style="text-align: center;">
                            净收益
                        </td>
                        <td class="title" style="text-align: center;">
                            平均日盈利
                        </td>
                        <td class="title leftyes" style="text-align: center;">
                            风险次数
                        </td>
                    </tr>
                    @{
                        allcount = 0;
                    }
                    @foreach (BenefitHelper.View.OperatorMonthSum sum in ViewBag.operatormonthsums)
                    {
                        allcount++;
                        if (allcount == ViewBag.operatormonthsums.Count)
                        {
                        <tr>
                            <td style="text-align: right;" class="bottomyes">
                                @sum.Operator.UName
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @sum.BillCount
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.Profit)
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.Free)
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", sum.DayCount)
                            </td>
                            <td style="text-align: right;" class="bottomyes">
                                @string.Format("{0:N2}", Math.Round(sum.DayCount / 22, 2))
                            </td>
                            <td style="text-align: right;" class="bottomyes leftyes">
                                @sum.RiskCount
                            </td>
                        </tr>
                        }
                        else
                        {
                        <tr>
                            <td style="text-align: right;">
                                @sum.Operator.UName
                            </td>
                            <td style="text-align: right;">
                                @sum.BillCount
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.Profit)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.Free)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", sum.DayCount)
                            </td>
                            <td style="text-align: right;">
                                @string.Format("{0:N2}", Math.Round(sum.DayCount / 22, 2))
                            </td>
                            <td style="text-align: right;" class="leftyes">
                                @sum.RiskCount
                            </td>
                        </tr>
                        }
                    }
                </table>
            </div>
        </div>
        <div style="height: 15px; width: 100%;">
        </div>
    </div>
</div>
